package com.sun.elasticjob.controller;

import com.sun.elasticjob.service.FileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class FileController {

    @Autowired
    private FileService fileService;

    // http://localhost:8080/generateFile/100
    @GetMapping("generateFile/{num}")
    public String generateFile(@PathVariable Long num) {
        fileService.generateFile(num);
        return "批量创建测试数据完成";
    }

    // http://localhost:8080/reset
    @GetMapping("reset")
    public String reset() {
        fileService.reset();
        return "重置备份状态完成";
    }

}
